/*
 * 牛牛协议
 */
let proto = module.exports;

proto.GAME_ROB_BANK_NOTIFY   = 301; /* 抢庄通知 */
proto.GAME_ROB_BANK_PUSH     = 401; /* 抢庄推送 */

proto.GAME_BANKER_PUSH       = 402; /* 庄家推送 */

proto.GAME_POUR_SCORE_NOTIFY = 303; /* 下分通知 */
proto.GAME_POUR_SCORE_PUSH   = 403; /* 下分推送 */


proto.GAME_SHOW_CARDS_NOTIFY = 304; /* 亮牌通知 */
proto.GAME_SHOW_CARDS_PUSH   = 404; /* 亮牌推送 */


proto.GAME_STATUS_PUSH       = 405; /* 游戏状态推送 */
proto.GAME_RESULT_PUSH       = 406; /* 游戏结果推送 */
proto.GAME_SEND_CARDS_PUSH   = 407; /* 发牌推送 */ 
proto.GAME_BUREAU_PUSH       = 408; /* 局数推送 */ 
proto.GAME_END_PUSH          = 409; /* 游戏结束推送 */

proto.GAME_CHAT_NOTIFY       = 310; /* 游戏聊天 */ 
proto.GAME_CHAT_PUSH         = 410;

proto.GAME_TRUST_NOTIFY      = 311; /* 托管 */ 
proto.GAME_TRUST_PUSH        = 411; /* 托管 */ 

proto.GAME_REVIEW_NOTIFY     = 312; /* 牌面回顾 */ 
proto.GAME_REVIEW_PUSH       = 412;


proto.gameStatus = {
	NONE:       0, /* 等待操作 */
	ROB_BANK:   1, /* 抢庄中 */
	POUR_SCORE: 2, /* 下分中 */
	SEND_CARDS: 3, /* 发牌中 */ 
	SHOW_CARDS: 4, /* 选择亮牌 */
	RESULT:     5, /* 显示结果 */
};

proto.gameStatusTm = {
	NONE:       0, /* 等待操作 */
	ROB_BANK:   10, /* 抢庄中 */
	POUR_SCORE: 10, /* 下分中 */
	SEND_CARDS: 1, /* 发牌中 */
	SHOW_CARDS: 10, /* 选择亮牌 */
	RESULT:     5, /* 显示结果 */
};

proto.payType = { /* 支付方式 */ 
	AAZHIFU: 1,
	YINGJIAZHIFU: 2,
	WOZHIFU: 3,
};

proto.gameType = {
	NIUNIU:      1, /* 牛牛上庄 */
	ZHIYOUQZ:    2, /* 自由抢庄 */
	LUNZHUANG:   3, /* 轮庄 */
	TONGBI:      4, /* 通比 */
	FANGZHU:     5, /* 房主坐庄 */
	MINGPAIQZ:   6, /* 明牌抢庄 */ 
};

proto.cardsType = {
	MEINIU:      1,  /* 没牛 */
	YOUNIU:      2,  /* 有牛 */
	NIUNIU:      3,  /* 牛牛 */
	SHUNZINIU:   4,  /* 顺子牛 */
	YINNIU:      5,  /* 银牛 */
	TONGHUANIU:  6,  /* 同花牛 */
	WUHUANIU:    7,  /* 五花牛 */
	HULUNIU:     8,  /* 葫芦牛 */
	WUXIAONIU:   9,  /* 五小牛 */
	ZHADANNIU:   10, /* 炸弹牛 */
	YITIAOLONG:  11, /* 一条龙 */
	TONGHUASHUN: 12, /* 同花顺 */
};

proto.sendCardType = {
	QUANAN:   1, /* 全暗 */ 
	MING3AN2: 2, /* 明3暗2 */ 
	MING4AN1: 3, /* 明4暗1 */ 
};

proto.scaleType = { /* 翻倍规则 */ 
	BIG:    1, /* 牛牛(x4)牛九(x3)牛八(x2)牛七(x2) */ 
	LITTLE: 2, /* 牛牛(x3)牛九(x2)牛八(x2) */ 
	DIANZI: 3, /* 点子牛 */
};

proto.gameRobBankNotify = function (robScale) {
	return {
		type: this.GAME_ROB_BANK_NOTIFY,
		data: {
			robScale: robScale,
		},
	};
};

proto.gameRobBankPush = function (chairID, robScale) {
	return {
		type: this.GAME_ROB_BANK_PUSH,
		data: {
			chairID: chairID,
			robScale: robScale,
		},
	};
};

proto.gameBankerPush = function (bankerChairID, robScale, robChairIDs) {
	return {
		type: this.GAME_BANKER_PUSH,
		data: {
			bankerChairID: bankerChairID,
			robScale: robScale,
			robChairIDs: robChairIDs,
		},
	};
};

proto.gamePourScoreNotify = function (score) {
	return {
		type: this.GAME_POUR_SCORE_NOTIFY,
		data: {
			score: score,
		},
	};
};

proto.gamePourScorePush = function (chairID, score) {
	return {
		type: this.GAME_POUR_SCORE_PUSH,
		data: {
			chairID: chairID,
			score: score,
		},
	};
};

proto.gameShowCardsNotify = function (cuopai) {
	return {
		type: this.GAME_SHOW_CARDS_NOTIFY,
		data: {
			cuopai: cuopai,
		},
	};
};

proto.gameShowCardsPush = function (chairID, cards, cuopai) {
	return {
		type: this.GAME_SHOW_CARDS_PUSH,
		data: {
			chairID: chairID,
			cards: cards,
			cuopai: cuopai,
		},
	};
};

proto.gameStatusPush = function (gameStatus, tick) {
	return {
		type: this.GAME_STATUS_PUSH,
		data: {
			gameStatus: gameStatus,
			tick: tick,
		},
	};
};

proto.gameResultPush = function (result) {
	return {
		type: this.GAME_RESULT_PUSH,
		data: {
			result: result,
		},
	};
};

proto.gameSendCardPush = function (handCards) {
	return {
		type: this.GAME_SEND_CARDS_PUSH,
		data: {
			handCards: handCards,
		},
	};
};

proto.gameBureauPush = function (curBureau) {
	return {
		type: this.GAME_BUREAU_PUSH,
		data: {
			curBureau: curBureau,
		},
	};
};

proto.gameEndPush = function (result, winMost, loseMost, creater) {
	return {
		type: this.GAME_END_PUSH,
		data: {
			result: result,
			winMost: winMost,
			loseMost: loseMost,
			creater: creater,
		},
	};
};

proto.gameChatNotify = function (type, msg, recipientID) {
	return {
		type: this.GAME_CHAT_NOTIFY,
		data: {
			type: type,
			msg: msg,
			recipientID: recipientID,
		},
	};
};

proto.gameChatPush = function (chairID, type, msg, recipientID) {
	return {
		type: this.GAME_CHAT_PUSH,
		data: {
			chairID: chairID,
			type: type,
			msg: msg,
			recipientID: recipientID,
		},
	};
};

proto.gameTrushNotify = function (trust) {
	return {
		type: this.GAME_TRUST_NOTIFY,
		data: {
			trust: trust,
		},
	};
};

proto.gameTrushPush = function (chairID, trust) {
	return {
		type: this.GAME_TRUST_PUSH,
		data: {
			chairID: chairID,
			trust: trust,
		},
	};
};

proto.gameReviewNotify = function () {
	return {
		type: this.GAME_REVIEW_NOTIFY,
		data: {
		},
	};
};

proto.gameReviewPush = function (list) {
	return {
		type: this.GAME_REVIEW_PUSH,
		data: {
			list: list,
		},
	};
};
